package com.steven.ourcontest.chat.viewmodel

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.steven.ourcontest.base.BaseViewModel
import com.steven.ourcontest.chat.api.ChatApi
import com.steven.ourcontest.chat.bean.UserDetailRes
import com.steven.ourcontest.utils.plusAssign

class SelectFriendViewModel : BaseViewModel() {
    private val _userDetailResponse = MutableLiveData<UserDetailRes>()
    val userDetailResponse: LiveData<UserDetailRes>
        get() = _userDetailResponse

    fun queryUserDetail(uid:Long) {
        disposed += ChatApi.instance.queryUserDetail(uid)
            .subscribe({
                _userDetailResponse.value = it
            }, {
                it.printStackTrace()
            })
    }
}